﻿using System.Windows.Controls;
using IMClient.Model.UI;
using IMClient.ViewModels;

namespace IMClient.View
{
    /// <summary>
    /// ContactsPageGroupsList.xaml 的交互逻辑
    /// </summary>
    public partial class ContactsPageGroupsList : UserControl
    {
        public ContactsPageGroupsList()
        {
            InitializeComponent();
        }
        private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (DataContext is ContactsPageGroupsListViewModel viewModel && sender is ListView listView)
            {
                var selectedGroup = listView.SelectedItem as GroupViewModel;

                // 更新 ViewModel 的 SelectedFriend 属性
                viewModel.SelectedGroup = selectedGroup;

                // 触发显示好友详情逻辑（如果需要）
                viewModel.ShowGroupDetailsCommand.Execute(null);
            }
        }
    }
}
